package com.cgmnx.admin.common.constants;

import com.google.common.collect.Maps;

import java.util.Map;


/**
 *
 */
public enum ErrorCodeConstant {

    SUCCESS(0, "成功", ModuleType.ALL);

    private static final Map<Integer, ErrorCodeConstant> elements = Maps.newHashMap();

    static {
        for (ErrorCodeConstant codeConstant : ErrorCodeConstant.values()) {
            elements.put(codeConstant.getCode(), codeConstant);
        }
    }

    private Integer code;
    private String desc;
    private ModuleType model;

    ErrorCodeConstant(Integer code, String desc, ModuleType model) {
        this.code = code;
        this.desc = desc;
        this.model = model;
    }

    public static Map<Integer, ErrorCodeConstant> getElements() {
        return elements;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public ModuleType getModel() {
        return model;
    }

    enum ModuleType {
        ALL;
    }
}